<?php
// +----------------------------------------------------------------------
// | zhanshop-marketing / AdlistenTest.php    [ 2025/4/30 09:03 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2025 zhangqiquan All rights reserved.
// +----------------------------------------------------------------------
// | Author: zhangqiquan <768617998@qq.com>
// +----------------------------------------------------------------------
declare (strict_types=1);

namespace test;

use zhanshop\client\Httpclient;
use zhanshop\TestCase;

class AdlistenTest extends TestCase
{
    public function testVivo非应用商店()
    {
        $clickUrl = 'http://127.0.0.1:7201/v1/ad.listen/zhanshop/vivo/click/rWg3eJOU3JVvbH3z_2F9CPEihxw31GgKmj8tm11AEyLxvp4JTuIXff1Bvdz7sjRDjZ?pkg_name=AAAAAA&src_type=APP&src_id=000000&os=__OS__&imei=__IMEI__&ip=__IP__&oaid=__OAID__&oaidplain=__OAIDPLAIN__&ua=__UA__&android_id=__ANDROIDID__&location=__LOCATION__&requestId=__REQUESTID__&requesttime=__REQUESTTIME__&osversion=__OSVERSION__&model=__MODEL__&lang=__LANG__&resolution=__RESOLUTION__&nettype=__NETTYPE__&ts=__TS__&advertiserId=__ADVERTISERID__&campaignId=__CAMPAIGNID__&groupId=__GROUPID__&adId=__ADID__&adName=__ADNAME__&creativeId=__CREATIVEID__&rtaexp=__RTAEXP__&custom_exp_id=__CUSTOM_EXP_ID__&expinfo=__EXPINFO__';
        $clickUrl = str_replace('__ADVERTISERID__', strval(time()), $clickUrl);
        $client = new Httpclient();
        $result = $client->request($clickUrl);
        if($result['code'] != 200){
            var_dump(json_decode($result['body'] ?? '{"data": "连接失败"}', true));
            die;
        }
        var_dump($result);
    }
    public function testHuawei()
    {

    }
}